// components/classic/music/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    // img: {
    //   type: String,
    // },
    content: {
      type: String,
    },
    hidden: {
      type: Boolean
    
    },
    onPlay:{
      type:Boolean
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    img:'https://gss3.bdstatic.com/7Po3dSag_xI4khGkpoWK1HF6hhy/baike/w%3D268%3Bg%3D0/sign=400d71ca80d6277fe912353e1003780d/5d6034a85edf8db10c1f99150e23dd54564e748a.jpg',
      img2: 'imges/music.png',
      play:'imges/play.png',
      pause:'imges/pause.png',
  },

  /**
   * 组件的方法列表
   */
  methods: {
    shift:function(){
      let onPlay = this.properties.onPlay
      this.setData({
        onPlay:!onPlay
        }
      )
      const audio = wx.getBackgroundAudioManager();
      if (this.properties.onPlay){
        audio.src ='http://www.ytmp3.cn/down/35843.mp3'
      }
      if(!this.properties.onPlay){
        audio.stop()
      }
    },
  }
})
